package com.woniu.service.impl;

import com.woniu.dao.AnnouncementMapper;
import com.woniu.dto.NoticePost;
import com.woniu.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private AnnouncementMapper announcementMapper;

    /**
     * 根据社区名查找所有公告
     * @param key key为""则查所有社区
     * @param page 查询开始页数,这里注意 0 1 所代表的是同一页，每页10条
     * @return
     */
    @Override
    public List<NoticePost> selectByKey(String key, Integer page) {
        return announcementMapper.selectByKey(key,page,10);
    }
}
